package com.my.swas.sso.module.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.my.swas.common.jwt.JWTUtils;
import com.my.swas.sso.module.admin.entity.App;
import com.my.swas.sso.module.admin.mapper.AppMapper;
import com.my.swas.sso.module.admin.service.AppService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description:
 * @author: :MaYong
 */
@Service
public class AppServiceImpl extends ServiceImpl<AppMapper,App> implements AppService {
    @Override
    public List<App> getAppByCurrentUser() {
        LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<App>()
                .eq(App::getCreatorId, JWTUtils.getUserId())
                .eq(App::getStatus,1)
                .eq(App::getDeleted,1);
        return this.list(queryWrapper);
    }
}
